import $http from "../assets/js/http";

// 密码确认
export async function roomInitializeConfirmPwd(pwd) {
  return $http.post("building/Building/roomInitializeConfirmPwd", {
    pwd
  });
}

// 房间初始化
export async function roomInitialize({
  _area,
  _dorm,
  beginLayers,
  endLayers,
  roomCount,
  roomType,
  roomSex,
  roomAnti,
  _number,
  roomCost,
  roomStatus,
  iSTemporary,
  cupboard,
  costBear
}) {
  return $http.post("building/Building/roomInitialize", {
    _area,
    _dorm,
    beginLayers,
    endLayers,
    roomCount,
    roomType,
    roomSex,
    roomAnti,
    _number,
    roomCost,
    roomStatus,
    iSTemporary,
    cupboard,
    costBear
  });
}

// 房间查询
export async function roomSearch({
  _area,
  _dorm,
  _sex,
  roomNumber,
  _person,
  page
}) {
  return $http.post("building/Building/roomSearch", {
    _area,
    _dorm,
    _sex,
    roomNumber,
    _person,
    page
  });
}

// 新建房间
export async function newRoom({
  area,
  dorm,
  floor,
  roomNumber,
  roomType,
  roomSex,
  full,
  roomStatus,
  isTemporary,
  roomCost,
  costBear,
  cupboard
}) {
  return $http.post("building/Building/newRoom", {
    area,
    dorm,
    floor,
    roomNumber,
    roomType,
    roomSex,
    full,
    roomStatus,
    isTemporary,
    roomCost,
    costBear,
    cupboard
  });
}

// 校验房间名称是否重复
export async function roomCheck(area, dorm, roomNumber) {
  return $http.post("building/Building/roomCheck", {
    area,
    dorm,
    roomNumber
  });
}

// 删除房间
export async function roomDel(area, dorm, roomNumber) {
  return $http.post("building/Building/roomDelete", {
    area,
    dorm,
    roomNumber
  });
}

// 修改房间
export async function alterRoom({
  affiliationNumber,
  dormNumber,
  layers,
  roomNumber,
  newRoomNumber,
  roomType,
  roomSex,
  full,
  roomStatus,
  isTemporary,
  roomCost,
  costBear,
  cupboard
}) {
  return $http.post("building/Building/alterRoom", {
    affiliationNumber,
    dormNumber,
    layers,
    roomNumber,
    newRoomNumber,
    roomType,
    roomSex,
    full,
    roomStatus,
    isTemporary,
    roomCost,
    costBear,
    cupboard
  })
}

// 房间查询
export async function getRoom(
  _area,
  _dorm,
  floor,
  type,
  sex,
  sort,
  department
) {
  return $http.post("building/Building/getRoom", {
    _area,
    _dorm,
    floor,
    type,
    sex,
    sort,
    department
  })
}
